package com.csoa.community.activity;

import android.view.View;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;

import com.collect.community.R;
import com.csoa.community.bean.LocalSpeciesBean;
import com.csoa.community.utils.StringUtils;

public class SpeciesInfoActivity extends BaseActivity {

	private EditText etChinese;
	private EditText etLatinName;
	private TextView etOwnOfDB;
	private EditText etKe;// 盖度
	private EditText etShu;
	private EditText etZhong;// 胸径
	private EditText etFullName;
	private EditText etAuthor;
	private EditText etFrom;// 性状

	private EditText etformationsWZ;// 所属群系
	private Spinner spinnerlevelWZ;// 层次
	private Spinner spinnernicheWZ;// 生态位
	private Spinner spinnerdistributionTypeWZ;// 群系分布方式
	private EditText etPrivince;// 分布区域
	private LocalSpeciesBean mSpeciesInfo;
	private EditText etShuXing;
	private EditText etFaYuanDi;
	private EditText etYuanChanDi;
	private EditText etCountry;

	@Override
	public void initUI() {
		mSpeciesInfo = (LocalSpeciesBean) this.getIntent().getSerializableExtra("SpeciesInfo");
		setContentView(R.layout.species_info_see);


		viewOnClick();


		etChinese = (EditText) this.findViewById(R.id.etChinese);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.Chinese)) {
			etChinese.setText(mSpeciesInfo.Chinese);
		}
		etLatinName = (EditText) this.findViewById(R.id.etLatinName);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.SName)) {
			etLatinName.setText(mSpeciesInfo.SName);
		}
		etOwnOfDB = (EditText) this.findViewById(R.id.etOwnOfDB);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.Type)) {
			etOwnOfDB.setText(mSpeciesInfo.Type);
		}
		etKe = (EditText) this.findViewById(R.id.etKe);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.Family)) {
			etKe.setText(mSpeciesInfo.Family);
		}
		etShu = (EditText) this.findViewById(R.id.etShu);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.Genus)) {
			etShu.setText(mSpeciesInfo.Genus);
		}
		etZhong = (EditText) this.findViewById(R.id.etZhong);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.Sp1)) {
			etZhong.setText(mSpeciesInfo.Sp1);
		}
		etFullName = (EditText) this.findViewById(R.id.etFullName);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.fullname)) {
			etFullName.setText(mSpeciesInfo.fullname);
		}
		etAuthor = (EditText) this
				.findViewById(R.id.etAuthor);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.Author1)) {
			etAuthor.setText(mSpeciesInfo.Author1);
		}
		etFrom = (EditText) this.findViewById(R.id.etFrom);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.cultivated)) {
			etFrom.setText(mSpeciesInfo.cultivated);
		}

		etShuXing = (EditText) this.findViewById(R.id.etShuXing);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.endemism)) {
			etShuXing.setText(mSpeciesInfo.endemism);
		}
		etFaYuanDi = (EditText) this
				.findViewById(R.id.etFaYuanDi);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.occurrence)) {
			etFaYuanDi.setText(mSpeciesInfo.occurrence);
		}



		etYuanChanDi = (EditText) this.findViewById(R.id.etYuanChanDi);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.originarea)) {
			etformationsWZ.setText(mSpeciesInfo.originarea);
		}
		
		etPrivince = (EditText) this
				.findViewById(R.id.etPrivince);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.Country)) {
			etPrivince.setText(mSpeciesInfo.Country);
		}
		
		etCountry = (EditText) this
				.findViewById(R.id.etCountry);
		if (mSpeciesInfo != null && !StringUtils.isEmpty(mSpeciesInfo.Disprovin)) {
			etCountry.setText(mSpeciesInfo.Disprovin);
		}


	}

	public void viewOnClick() {
		

		this.findViewById(R.id.btnClose).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						finish();
					}
				});

		this.findViewById(R.id.btnBackYF).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						finish();

					}
				});
	}
	
	


	@Override
	public void initData() {

	}


}
